package cn.circle.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import cn.circle.system.dao.ISystemDao;
import com.graduation.system.model.SysCustomer;
import cn.circle.system.service.ISystemService;

@Repository
public class SystemService implements ISystemService{

	@Autowired
	private ISystemDao systemDao;
	
	public Boolean login(String userName,String userPwd) {
		// TODO Auto-generated method stub
		
		List<SysCustomer> cml = systemDao.login(userName,userPwd);
		if(cml.isEmpty()){
			return false;
		}else{
			if(cml.get(0).getUserName().equals(userName) && cml.get(0).getPassWord().equals(userPwd)){
				return true;
			}else{
				return false;
			}
		}
	}

	public Boolean register(SysCustomer c) {
		// TODO Auto-generated method stub
		return systemDao.register(c);
	}
	
	
}
